Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(search): adjust icon and hover styles on Close16 button for Chrome's new autofill color #4891

Merged
merged 10 commits into from
Dec 18, 2019
Merged

Conversation

abbeyhrt
Copy link
Contributor

@abbeyhrt abbeyhrt commented Dec 16, 2019

Closes #4808

Chrome's new sky blue autofill color makes Close16 in the Search component disappear for the dark themes and there is a very visible black line:

Screen Shot 2019-12-16 at 2 12 46 PM

This PR makes it so the icon is visible when this autofill color is used with a vendor prefix and adjusts the hover color. I used the hex value from the light themes from $hover-field instead of the token because I didn't want to the dark theme's color to apply here. With this change, this is what the hover on the cancel button looks like in dark theme with Chome's autofill color present:

Screen Shot 2019-12-16 at 12 41 23 PM

Changelog

New

  • styles for Chrome's new autofill color

Removed

Testing / Reviewing

Designers: I'm not sure if this is how we want to solve this problem! There are a couple different things we can do and this is just one implementation, let me know if you want the hover color to be different or if we want to go with a different approach

@abbeyhrt abbeyhrt requested a review from a team as a code owner December 16, 2019 20:20
@ghost ghost requested review from aledavila and asudoh December 16, 2019 20:21
@abbeyhrt abbeyhrt requested a review from a team December 16, 2019 20:21
@ghost ghost requested review from aagonzales and removed request for a team December 16, 2019 20:21
@abbeyhrt abbeyhrt changed the title Fix search autocomplete fix(search): adjust icon and hover styles on Close16 button for Chrome's new autofill color Dec 16, 2019
@netlify
Copy link

netlify bot commented Dec 16, 2019

Deploy preview for the-carbon-components ready!

Built with commit dfb10a0

https://deploy-preview-4891--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Dec 16, 2019

Deploy preview for carbon-components-react ready!

Built with commit dfb10a0

https://deploy-preview-4891--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Dec 16, 2019

Deploy preview for carbon-elements ready!

Built with commit dfb10a0

https://deploy-preview-4891--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Dec 16, 2019

Deploy preview for the-carbon-components ready!

Built with commit 48820df

https://deploy-preview-4891--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Dec 16, 2019

Deploy preview for carbon-elements ready!

Built with commit 48820df

https://deploy-preview-4891--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Dec 16, 2019

Deploy preview for carbon-components-react failed.

Built with commit 48820df

https://app.netlify.com/sites/carbon-components-react/deploys/5dfa8ce069f83f000736b394

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for jumping in @abbeyhrt!

}

.#{$prefix}--search-input:-webkit-autofill ~ .#{$prefix}--search-close:hover {
background-color: #e5e5e5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK to make this non-themeable? Also, is there really no way to override :-webkit-autofill? Some sites seem to suggest adding box-shadow to override the color.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is! I wasn't sure if we would want to remove the autofill indicator or style around it, I wanted to propose a solution so designers could weigh in on the preferred workaround

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you for explaining @abbeyhrt - It'll be a good discussion to see it with designers wrt what the (themable) background color of such state should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific solution, I think the autofill replacement background color might need to use the hex value since if you use any of the hover tokens, for example $hover-field it will look like this:
Screen Shot 2019-12-16 at 4 41 36 PM
which is too dark, i think. Since this only affects when the chrome autofill color is there, it shouldn't have any greater impact on the themes. I'm down to try other things though! This is just what I came up with when looking for a solution 🙂

@abbeyhrt
Copy link
Contributor Author

This can be a hard problem to reproduce so here are some videos showing the current problem and the visual solution from this PR!
Current problem (chrome's new autofill color makes Close16 invisible):

SearchBarProblem

Proposed solution:

SearchBarSolution

@aagonzales
Copy link
Member

aagonzales commented Dec 17, 2019

I think maybe search shouldn't have the browser auto-fill feature turned on. I've been trying to think of a use-case for search where a user would need this. With @connor-leech's search pattern work, type ahead and recently searched items would be a part of the component itself. I think auto-fill is more useful for forms elements.

@aagonzales
Copy link
Member

In general I think if the component has (or could have) its own menu we should avoid auto complete features because the auto complete can cover up functionality in the component, like here in data picker. And to my knowledge there's no easy way to dismiss the auto-complete.

image

@abbeyhrt
Copy link
Contributor Author

@aagonzales That makes sense to me! I removed the style changes and turned the autocomplete off for the search input 👍

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 - Thanks @abbeyhrt!

@asudoh asudoh merged commit 098378f into carbon-design-system:master Dec 18, 2019
@SimonFinney
Copy link
Contributor

Thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search: Autocomplete color contrast in Chrome
6 participants